﻿using MongoDB.Driver;
using MvcOSGi.Shell.Infra;
using MvcOSGi.Shell.Properties;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MvcOSGi.Shell.App_Start
{
    public class CompanyDBContext
    {
        public MongoDatabase Database;
        //public RequestInfo RequestInfo;

        public CompanyDBContext()
        {
            var client = new MongoClient(Settings.Default.VersionConnectionString);
            var server = client.GetServer();
            Database = server.GetDatabase(Settings.Default.CompanyDatabaseName);
        }

        public MongoCollection<Company.Company> Domains
        {
            get
            {
                return Database.GetCollection<Company.Company>("companies");
            }
        }
    }
}